class Jquery{
    constructor(selector){
        console.log(selector)
       let slice = Array.prototype.slice
        //document.querySelectorAll(selector) 返回一个数组，为[p,p,p]
       let dom = slice.call(document.querySelectorAll(selector))  //将dom 元素（数组形式)拿到然后赋值给dom
       let len = dom ? dom.length : 0
       for (let i = 0;i<len;i++){
           this[i] = dom[i]
       }
       this.length = len
        this.selector = selector || ''
    }

    append(node){

    }
    addClass(name){

    }
    html(name){

    }
    test(name){

    }
}
window.$ = function (selector) {
    //工厂模式
    return new Jquery(selector)
}
export default {
    Jquery
}